package com.sgb.goods.view.activity;

import android.content.Intent;
import android.text.InputType;
import android.text.TextUtils;
import android.view.View;

import androidx.annotation.Nullable;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.luck.picture.lib.PictureSelector;
import com.luck.picture.lib.config.PictureConfig;
import com.sgb.goods.BR;
import com.sgb.goods.R;
import com.sgb.goods.databinding.GoodsActivityGoodsPublish2Binding;
import com.sgb.goods.entity.GoodsPublishEntity;
import com.sgb.goods.entity.GoodsPublishSkuListEntity;
import com.sgb.goods.entity.MenuEntity1;
import com.sgb.goods.entity.STPublishEntity;
import com.sgb.goods.entity.StorageManEntity;
import com.sgb.goods.entity.VideoEntity;
import com.sgb.goods.utils.Constants;
import com.sgb.goods.utils.StringUtils;
import com.sgb.goods.utils.base.BaseActivity;
import com.sgb.goods.view.adapter.publish.UtilSelectUtils;
import com.sgb.goods.view.adapter.publish.VideoAdapter;
import com.sgb.goods.viewmodel.publish.DynamicComponentsViewModel;
import com.sgb.goods.viewmodel.publish.GoodsPublishViewModel2;
import com.sgb.goods.viewmodel.publish.ImageUploadViewModel;
import com.sgb.goods.viewmodel.publish.PublishPopViewModel2;
import com.sgb.goods.viewmodel.publish.VideoUploadViewModel;
import com.sgb.goods.widget.DialogHelper;
import com.swgk.core.util.MToast;
import com.swgk.core.util.SharedPreferenceUtil;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard;

/**
 * 重构版的 商品发布
 * @author cyj
 */
@Route(path = Constants.ARouter.AR_GOODS_PUBLISH_2)
public class GoodsPublishActivity2 extends BaseActivity<GoodsActivityGoodsPublish2Binding, GoodsPublishViewModel2> {

    public static final int VIDEO_ADAPTER_LIST = 119110;
    public static final int IMAGE_ADAPTER_LIST = 110119;

    // 详情id
    private String id;
    // 操作类型。1：发布商品；2：编辑商品；
    private String operationType = "1";

    private ImageUploadViewModel imageUploadViewModel;
    private DynamicComponentsViewModel dcpViewModel;
    private VideoUploadViewModel videoUploadViewModel;
    private PublishPopViewModel2 publishPopViewModel;

    @Override
    protected int getLayoutResId() {
        return R.layout.goods_activity_goods_publish2;
    }

    @Override
    protected void initViewModel() {
        mViewModel = createViewModel(GoodsPublishViewModel2.class, BR.viewModel);
        imageUploadViewModel = createViewModel(ImageUploadViewModel.class);
        mDataBinding.setVariable(BR.imageViewModel, imageUploadViewModel);
        videoUploadViewModel = createViewModel(VideoUploadViewModel.class);
        mDataBinding.setVariable(BR.videoViewModel, videoUploadViewModel);
        dcpViewModel = createViewModel(DynamicComponentsViewModel.class);
        publishPopViewModel = createViewModel(PublishPopViewModel2.class);
    }

    @Override
    protected void init() {
        mDataBinding.head.title.setText("商品发布");
        id = getIntent().getStringExtra("id");
        operationType = getIntent().getStringExtra("operationType");
        mViewModel.isST.set(getIntent().getBooleanExtra("isST", false));

        // 代码设置几个输入框的限制
        mDataBinding.itemBuyLow.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
        mDataBinding.itemTvBsprice.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
        mDataBinding.itemTvBsprice.setCheck(4, 2);
        mDataBinding.itemTvTax.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
        mDataBinding.itemTvTax.setNumberAndLetter("0123456789");
        mDataBinding.itemTvTax.setCheck(2, 2);
        mDataBinding.itemTvPrice.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
        mDataBinding.itemTvLeavePrice.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
        mDataBinding.itemTvLeavePrice.setCheck(4, 2);
    }

    @Override
    protected void initListener() {
        // 商品分类弹窗
        mDataBinding.itemTvArr.setOnWholeItemClickListener(view -> {
            showGoodsTypePopWindow();
        });

        // 仓储弹窗
        mDataBinding.itemTvStorage.setOnWholeItemClickListener(view -> {
            showStoragePopWindow();
        });

        // 品牌弹窗
        mDataBinding.itemTvBrand.setOnWholeItemClickListener(view -> {
            showBrandPopWindow();
        });

        // 单位弹窗
        mDataBinding.itemTvUnit.setOnWholeItemClickListener(view -> {
            showUnitPopWindow();
        });

        // 货期弹窗
        mDataBinding.itemTvFutures.setOnWholeItemClickListener(view -> {
            showFuturesPopWindow();
        });

        // 退出页面保存草稿；fixme:未实现返回键拦截
        mDataBinding.head.ivBack.setOnClickListener(v -> {
            DialogHelper.showDialog(GoodsPublishActivity2.this, "温馨提示", "是否保存草稿?", "不保存", new DialogHelper.DialogFunction() {
                        @Override
                        public void normalRoundDialog() {
                            finish();
                        }
                    }, "保存", new DialogHelper.DialogFunction() {
                        @Override
                        public void normalRoundDialog() {
                            MToast.showToast(GoodsPublishActivity2.this, "暂未实现，退出了");
                            finish();
                        }
                    });
        });

        // 商品主图点击弹窗
        imageUploadViewModel.imageAdapter.OnSelectPop(this::showSelectAlbumPopWindow);

        // 商品视频点击弹窗
        videoUploadViewModel.videoAdapter.OnSelectPop(new VideoAdapter.ISelectPop() {

            @Override
            public void openPop(int index) {
                videoUploadViewModel.openPopWindow(mDataBinding.llPar, index);
            }

            @Override
            public void openVideo(VideoEntity data) {
                mDataBinding.videoView.setUp(data.url, JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, data.title);
                mDataBinding.rlVideo.setVisibility(View.VISIBLE);
            }
        });

        // 商品发布   上传成功后(uploadImgUrlLD.observe)进行商品发布
        mDataBinding.nextView.setOnClickListener(v -> {
            if(goodsCheck()) {
                // 参数检查成功后，开始图片上传，最后再进行商品发布
                if (imageUploadViewModel.imageAdapter.getDataSize() != 0) {
                    // 选择了图片，那么从第一张开始上传
                    imageUploadViewModel.uploadImage(1);
                }
            }
        });

        mDataBinding.itemTvSpec.setOnWholeItemClickListener(v -> {
            MToast.showToast(this, "选择规格");
            ARouter.getInstance().build(Constants.ARouter.AR_GOODS_SPEC)
                    .withParcelableArrayList("combination", null == mViewModel.combination.getValue() ?
                            new ArrayList<>() : mViewModel.combination.getValue())
                    .withString("cid3", mViewModel.cId3.get()).navigation();
        });
    }

    @Override
    protected void initObserve() {
        // 设置自动商品标题补全名称
        mViewModel.goodsName.observe(this, goodsName -> {
            getGoodsPublishEntity().name = goodsName;
            setAutoTitleShow();
        });
        // 设置自动商品标题补全名称
        mViewModel.brandName.observe(this, brandName -> {
            setAutoTitleShow();
        });

        // 是否显示sku规格
        mViewModel.getSkuListLD.observe(this, list -> {
            //islooks = null != list && list.size() <= 0;
        });

        mViewModel.combination.observe(this, combination -> {
            mDataBinding.itemTvSpec.setContent("已填写");
        });

        // 上传图片
        imageUploadViewModel.uploadImgUrlLD.observe(this, list -> {
            //mViewModel.goodsPublish();
        });
    }

    //商品验证
    private boolean goodsCheck() {
        if (TextUtils.isEmpty(mDataBinding.itemTvArr.getContent())) {
            MToast.showToast(this, "请选择商品分类");
            return false;
        } else if (TextUtils.isEmpty(mDataBinding.etName.getText().toString().trim())) {
            MToast.showToast(this, "请输入商品名称");
            return false;
        } else if (mDataBinding.etName.getText().toString().trim().length() > 32) {
            MToast.showToast(this, "商品名称字数超出限制");
            return false;
        } else if (TextUtils.isEmpty(mDataBinding.itemTvStorage.getContent())) {
            MToast.showToast(this, "请选择仓储");
            return false;
        } else if (TextUtils.isEmpty(mDataBinding.itemTvTax.getContent())) {
            MToast.showToast(this, "请输入税率");
            return false;
        }  else if (TextUtils.isEmpty(mDataBinding.itemTvUnit.getContent())) {
            MToast.showToast(this, "请选择单位");
            return false;
        } else if (mViewModel.getSkuListLD.getValue() != null && mViewModel.getSkuListLD.getValue().size() != 0 && mDataBinding.itemTvSpec.getContent().equals("")) {
            MToast.showToast(this, "请配置规格属性");
            return false;
        } else if (imageUploadViewModel.imageAdapter.getDataSize() == 0) {
            MToast.showToast(this, "请选择图片");
            return false;
        } else if (mDataBinding.itemTvSpec.getContent().equals("")) {
            if (mViewModel.arrListLD.getValue() != null && mViewModel.arrListLD.getValue().size() != 0
                    && TextUtils.isEmpty(mDataBinding.itemTvPrice.getContent())) {
                MToast.showToast(this, "请输入单价");
                return false;
            }
        } else if (TextUtils.isEmpty(mDataBinding.itemBuyLow.getContent())) {
            MToast.showToast(this, "请输入最低采购量");
            return false;
        }

        // 检查商品必填属性是否填写
        boolean isSelect = false;
        String arrName = "";
        getGoodsPublishEntity().attrList = mViewModel.attrChildEntityList;
        if (getGoodsPublishEntity().attrList != null) {
            for (int i = 0; i < getGoodsPublishEntity().attrList.size(); i++) {
                if (getGoodsPublishEntity().attrList.get(i).attrValue == null
                        && getGoodsPublishEntity().attrList.get(i).isfill != null
                        && 1 == getGoodsPublishEntity().attrList.get(i).isfill) {
                    arrName = getGoodsPublishEntity().attrList.get(i).attrKey;
                    break;
                }
                isSelect = true;
            }
        }
        if (!isSelect && (mViewModel.arrListLD.getValue() != null && mViewModel.arrListLD.getValue().size() != 0)) {
            MToast.showToast(this, "请选择" + arrName);
            return false;
        }

        // 设置商品的其他数据
        getGoodsPublishEntity().otherInfos = dcpViewModel.getOtherData();

        getGoodsPublishEntity().lowestBuy = mDataBinding.itemBuyLow.getContent();

//        if (islooks) {
//            if (TextUtils.isEmpty(mDataBinding.itemTvPrice.getContent())) {
//                MToast.showToast(this, "请输入单价");
//                return false;
//            }
//            if (Double.parseDouble(mDataBinding.itemTvPrice.getContent()) == 0) {
//                MToast.showToast(this, "请输入正确的单价");
//                return false;
//            }
//            if (Objects.requireNonNull(getGoodsPublishEntity()).skuList != null
//                    && getGoodsPublishEntity().skuList.size() == 1
//                    && !TextUtils.isEmpty(getGoodsPublishEntity().skuList.get(0).money)
//                    && !TextUtils.isEmpty(getGoodsPublishEntity().skuList.get(0).vipMaxPrice)) {
//
//                BigDecimal money = new BigDecimal(mDataBinding.itemTvPrice.getContent());
//                BigDecimal vipMaxPrice = new BigDecimal(getGoodsPublishEntity().skuList.get(0).vipMaxPrice);
//                if (money.compareTo(vipMaxPrice) < 0) {
//                    //平销价小于会员价
//                    MToast.showToast(this, "平销价不能低于会员价");
//                    return false;
//                }
//            }
//        }

        // 商品详情查询后带过来的sku对象，则直接对商品对象赋值
        if (mViewModel.getSkuListLD.getValue() != null && mViewModel.combination.getValue() != null && mViewModel.getSkuListLD.getValue().size() != 0) {
            for (int i = 0; i < mViewModel.combination.getValue().size(); i++) {
                mViewModel.combination.getValue().get(i).category = mViewModel.cId3.get();
                mViewModel.combination.getValue().get(i).unit = mDataBinding.itemTvUnit.getContent();
            }
            getGoodsPublishEntity().skuList = mViewModel.combination.getValue();
        } else {
            // 不是详情带过的sku对象
            List<GoodsPublishSkuListEntity> skuList = new ArrayList<>();
            GoodsPublishSkuListEntity goodsPublishSkuListEntity = new GoodsPublishSkuListEntity();
            goodsPublishSkuListEntity.category = mViewModel.cId3.get();
            goodsPublishSkuListEntity.money = mDataBinding.itemTvPrice.getContent();
            goodsPublishSkuListEntity.type = 0;
            if (getGoodsPublishEntity().skuOldList != null && getGoodsPublishEntity().skuOldList.size() != 0) {
                goodsPublishSkuListEntity.id = getGoodsPublishEntity().skuOldList.get(0).id;
            }
            skuList.add(goodsPublishSkuListEntity);
            getGoodsPublishEntity().skuList = skuList;
        }
        getGoodsPublishEntity().companyId = SharedPreferenceUtil.getInstance().getSaveStringData(SharedPreferenceUtil.REAL_ID, "");

        return true;
    }

    /** 设置自动标题填充，若是三个字段有其一值为空则不显示 */
    private void setAutoTitleShow() {
        // 判断这两项即可等效判断与三个字段不为空
        if(!StringUtils.isEmpty(mViewModel.goodsName.getValue()) && !StringUtils.isEmpty(mViewModel.brandName.getValue())) {
            mViewModel.autoTitle.set(mViewModel.goodsName.getValue() + "/"
                    + mViewModel.brandName.getValue() + "/"
                    + getGoodsPublishEntity().cid3Name);
        } else {
            mViewModel.autoTitle.set("");
        }
    }

    /** 显示视频弹窗 */
    public void showVideoSelectPopWindow() {
        if (null == publishPopViewModel.videoListSelectPopWindow) {
            publishPopViewModel.getVideoSelectPopWindow().setOnResultClick((key1, key2, key3) -> {
                //selectVideo2((int) key1, (VideoEntity) key2, (int) key3);
                videoUploadViewModel.getVideoParams();
            });
        }
        publishPopViewModel.getVideoSelectPopWindow().showAsDropDown(mDataBinding.llPar);
    }

    /** 选择相册弹窗 */
    private void showSelectAlbumPopWindow() {
        if(null == publishPopViewModel.selectAlbumPopWindow) {
            publishPopViewModel.getSelectAlbumPopWindow(mDataBinding.llPar).setOnResultClick((key1, key2, key3) -> {
                if ((int) key1 == 0) {
                    imageUploadViewModel.imageAdapter.openAlbum();
                } else {
                    MToast.showToast(GoodsPublishActivity2.this, "暂未实现商砼的网络相册选择");
                    // fixme: 这应该是跳转选择图库的页面的
                    //EventBus.getDefault().postSticky(MaterialEvent.make().setMessageTag(EventConstant.EVENT_GOODS_NET_IMG_SELECT_RE).setMessageData(netUrl).setObject(canSelect));
                }
            });
        }
        publishPopViewModel.getSelectAlbumPopWindow(mDataBinding.llPar).showAsDropDown(mDataBinding.llPar);
    }

    /** 显示商品类型弹窗 */
    private void showGoodsTypePopWindow() {
        if(null == publishPopViewModel.goodsTypePopWindow) {
            publishPopViewModel.getGoodsTypePopWindow().setOnResultClick((key1, key2, key3) -> {
                // 一级（左侧列表一级数据），obj1.id 代表 cid1
                MenuEntity1 obj1 = (MenuEntity1) key1;
                // 二级（右侧列表一级数据），obj2.id 代表 cid2
                MenuEntity1 obj2 = (MenuEntity1) key2;
                // 三级（右侧列表二级数据），obj3.id 代表 cid3
                MenuEntity1 obj3 = (MenuEntity1) key3;

                // 商品类型选择时，判断是否选择的商砼类型商品
                mViewModel.isST.set("商砼".equals(obj1.name));
                mDataBinding.itemTvArr.setContent(obj1.name + "-" + obj2.name + "-" + obj3.name);
                
                if (!mViewModel.isST.get()) {
                    if (!StringUtils.isEmpty(obj3.id) && !obj3.id.equals(mViewModel.cId3.get())) {
                        mViewModel.brandName.setValue("");
                        mViewModel.getMaterChoose(obj3.id);
                        mViewModel.getServiceCategory(obj3.id, false);
                        mViewModel.isReset = true;
                        mDataBinding.itemTvBrand.setContent("");
                        mViewModel.getSku(obj3.id);
                        dcpViewModel.getAddLayout(obj3.id);
                    }

                    getGoodsPublishEntity().cid1 = obj1.id;
                    getGoodsPublishEntity().cid2 = obj2.id;
                    getGoodsPublishEntity().cid3 = obj3.id;
                    getGoodsPublishEntity().cid1Name = obj1.name;
                    getGoodsPublishEntity().cid2Name = obj2.name;
                    getGoodsPublishEntity().cid3Name = obj3.name;
                } else {
                    if (!StringUtils.isEmpty(obj3.id) && !obj3.id.equals(mViewModel.cId3.get())) {
                        dcpViewModel.getAddLayout(obj3.id);
                    }
                    mViewModel.concreteAttrs(0);
                    mViewModel.getServiceCategory(obj3.id, true);
                }
                // 设置全局 cid3 赋值
                mViewModel.cId3.set(obj3.id);
            });
        }
        publishPopViewModel.getGoodsCategory(mDataBinding.llPar);
    }

    /** 选择品牌的弹窗，只有先选择了商品类型才能选择品牌弹窗 */
    private void showBrandPopWindow() {
        if (StringUtils.isEmpty(getGoodsPublishEntity().cid3)) {
            MToast.showToast(GoodsPublishActivity2.this, "请先选择商品分类");
            return;
        }
        if(null == publishPopViewModel.brandPopWindow) {
            publishPopViewModel.getBrandPopWindow(mDataBinding.llPar).setOnResultClick((key1, key2, key3) -> {
                getGoodsPublishEntity().brandId = (String) key1;
                mViewModel.brandName.setValue((String) key2);
            });
        }
        publishPopViewModel.getBrandList(mDataBinding.llPar, getGoodsPublishEntity().cid3);
    }

    /** 显示仓储弹窗 */
    private void showStoragePopWindow() {
        if(null == publishPopViewModel.storagePopWindow) {
            publishPopViewModel.getStoragePopWindow(mDataBinding.llPar).setOnResultClick((key1, key2, key3) -> {
                StorageManEntity storageManEntity = (StorageManEntity) key1;
                if (!mViewModel.isST.get()) {
                    mViewModel.storageName.setValue(storageManEntity.storageName);
                    getGoodsPublishEntity().depotNo = storageManEntity.no;
                    getGoodsPublishEntity().cityNo = storageManEntity.cityNo;
                    getGoodsPublishEntity().provinceNo = storageManEntity.provinceNo;
                    getGoodsPublishEntity().districtNo = storageManEntity.districtNo;
                } else {
                    getSTPublishEntity().depotNo = storageManEntity.no;
                    getSTPublishEntity().cityNo = storageManEntity.cityNo;
                    getSTPublishEntity().provinceNo = storageManEntity.provinceNo;
                    getSTPublishEntity().districtNo = storageManEntity.districtNo;
                }
            });
        }
        publishPopViewModel.getStorageList(mDataBinding.llPar, false);
    }

    /** 选择单位弹窗 */
    private void showUnitPopWindow() {
        if(null == publishPopViewModel.unitPopWindow) {
            publishPopViewModel.getUnitPopWindow(mDataBinding.llPar).setOnResultClick((key1, key2, key3) -> {
                mDataBinding.itemTvUnit.setContent((String) key2);
                setBuyLow((String) key2, true);
            });
        }
        publishPopViewModel.getUnitList(mDataBinding.llPar);
    }

    /** 设置最低采购量 */
    private void setBuyLow(String key, boolean isChange) {
        if (UtilSelectUtils.isDouble3(key)) {
            mDataBinding.itemBuyLow.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
            mDataBinding.itemBuyLow.setCheck(6, 3, true);
            if (isChange) {
                mDataBinding.itemBuyLow.setContent("1.000");
            }
        } else {
            mDataBinding.itemBuyLow.setInputType(InputType.TYPE_CLASS_NUMBER);
            mDataBinding.itemBuyLow.setEditLength(6);
            if (isChange) {
                mDataBinding.itemBuyLow.setContent("1");
            }
        }
    }

    /** 选择贷期弹窗 */
    private void showFuturesPopWindow() {
        if(null == publishPopViewModel.futuresPopWindow) {
            publishPopViewModel.getFuturesPopWindow(mDataBinding.llPar).setOnResultClick((key1, key2, key3) -> {
                mViewModel.futuresType.set(null != key2 && (boolean) key2);
                getGoodsPublishEntity().commodityType = mViewModel.futuresType.get() ? 1 : 2;
                if(mViewModel.futuresType.get()) {
                    mViewModel.futuresContent.set(null == key1 ? "" : key1.toString());
                } else {
                    getGoodsPublishEntity().deliveryTime = Long.parseLong(key1.toString());
                    getGoodsPublishEntity().deliveryTimeUnit = (boolean) key3 ? 1 : 2;
                    mViewModel.futuresContent.set(key1.toString() + ((boolean) key3 ? "日" : "个月"));
                }
            });
        }
        publishPopViewModel.getFuturesPopWindow(mDataBinding.llPar).setPopData(
                Objects.requireNonNull(mViewModel.futuresContent.get()).replace("日", "").replace("个月", ""),
                mViewModel.futuresType.get(),
                Objects.requireNonNull(mViewModel.futuresContent.get()).contains("日"));
        publishPopViewModel.getFuturesPopWindow(mDataBinding.llPar).showAsDropDown(mDataBinding.llPar);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(999 == resultCode) {
            // 商品品牌弹窗-添加品牌(页面)-操作：回退到当前页时的数据回调，刷新列表并显示加载出新添加的品牌到列表中
            publishPopViewModel.getBrandList(mDataBinding.llPar, getGoodsPublishEntity().cid3);
        } else if(998 == resultCode) {
            // 商品仓储弹窗-添加仓储(页面)-操作：回退到当前页时的数据回调，刷新列表并显示加载出新添加的仓储到列表中
            publishPopViewModel.getStorageList(mDataBinding.llPar, false);
        } else if (resultCode == RESULT_OK) {
            if (requestCode == PictureConfig.CHOOSE_REQUEST) {
                // 图片、视频、音频选择结果回调
                //imageUploadViewModel.imageAdapter.setNewData(imageUploadViewModel.imageAdapter.convertDataToAlbumEntity(PictureSelector.obtainMultipleResult(data), true));
            } else if (requestCode == PictureConfig.TYPE_VIDEO) {
//                locVideoList = PictureSelector.obtainMultipleResult(data);
//                videoSelectPopWindow.setData(locVideoList, indexVideo);
                videoUploadViewModel.setLocalMediaData(PictureSelector.obtainMultipleResult(data));
            } else if (requestCode == IMAGE_ADAPTER_LIST) {
                // ImageAdapter 数据设置
                imageUploadViewModel.imageAdapter.setData(PictureSelector.obtainMultipleResult(data));
            } else if (requestCode == VIDEO_ADAPTER_LIST) {
                // VideoAdapter 数据设置
                publishPopViewModel.getVideoSelectPopWindow().setData(PictureSelector.obtainMultipleResult(data), dcpViewModel.mPVideoIndex.get(dcpViewModel.mVideoAdapterPosition));
            }
        }
    }
    
    public GoodsPublishEntity getGoodsPublishEntity() {
        return mViewModel.goodsPublishEntity.get();
    }

    public STPublishEntity getSTPublishEntity() {
        return mViewModel.sTPublishEntity.get();
    }
}
